<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="../js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=3a6ad0f81d4679a83b39818ae59913f1"></script>
<title>百度地图的Hello, World</title>
<style type="text/css">
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}
</style>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
   function person(data) {
	alert(data);
   }
var map = new BMap.Map('allmap');
map.centerAndZoom(new BMap.Point(103.520088, 30.577261), 18);

var icon = new BMap.Icon('huoche4.jpg', new BMap.Size(45, 30), {
    anchor: new BMap.Size(0, 0),
    infoWindowAnchor: new BMap.Size(10, 0)
});
var mkr = new BMap.Marker(new BMap.Point(103.520088,30.577261), {
    icon: icon,
	enableDragging: true,
    raiseOnDrag: true
});

mkr.addEventListener('click', function(e){
    var jinwei = e.point.lat + ","+ e.point.lng;  

	$.ajax({
        url:"http://api.map.baidu.com/geocoder?location="+jinwei+"&output=json&key=3a6ad0f81d4679a83b39818ae59913f1&callback=?",   
        dataType:"jsonp",
        jsonpCallback:"person",
        success:function(data){
            alert("sdf");
        }
   });
});

map.addOverlay(mkr);



</script>


